#pragma once
#include "Singleton.h"
#include "boost/asio.hpp"
#include <vector>

class AsioThreadPool:public Singleton<AsioThreadPool>
{
    friend class Singleton<AsioThreadPool>;
public:
    ~AsioThreadPool();
    boost::asio::io_context& GetIOService();
    void Stop();
private:
    AsioThreadPool(int thread_num=std::thread::hardware_concurrency());

private:
    std::vector<std::thread> threads_;
    boost::asio::io_context io_context_;
    std::unique_ptr<boost::asio::io_context::work> work_;
    

};

